<html>
	<head>
		<title>Newton Game Dynamics DBPro Wrapper v1.53</title></head>
	<body alink="#fa634e" bgcolor="#efeff9" link="#3646fc" text="#000000" vlink="#ff6633">
		<H1>Newton SDK DBPro Wrapper v1.53</H1>
		<P>By Walaber<BR>
		   All Coding between 1.31-1.32B by Kjelle<BR>
		   Updated to 1.53 by Tiresius</P>
        <p><a href="ndb_docs_main.htm">Main Index of Commands</a></p>
		<h2>Group ID Interface Commands</h2>
			<a name="NDB_NewtonMaterialGetDefaultGroupID"></a>
			<table cellspacing="0" bordercolorlight="#0506a5" bordercolordark="#0506a5" bgcolor="#ffffff"
				border="1" width="85%">
				<tbody>
					<tr>
						<td bgcolor="#232323"><h3><font color="#fafafa">NDB_NewtonMaterialGetDefaultGroupID</font></h3>
						</td>
					</tr>
					<tr>
						<td bgcolor="#747ff6"><font color="#ffffff" face="monospace">syntax: int =
								NDB_NewtonMaterialGetDefaultGroupID()</font></td>
					</tr>
					<tr>
						<td bgcolor="#fafafa"><font face="monospace">
								<table border="0" width="95%">
									<tbody>
										<tr>
											<td width="5%"></td>
											<td width="50%">no variables passed to this function</td>
											<td></td>
										</tr>
									</tbody></table>
							</font>
						</td>
					</tr>
					<tr>
						<td bgcolor="#dadada"><font face="monospace">returns: integer index of the default
								material group ID. </font>
						</td>
					</tr>
					<tr>
						<td bgcolor="#fafafa"><b>Comments:</b> When rigid bodies are created, they are
							automatically assigned the "default" material, which defines things like
							friction, etc. This function returns the ID to the default material, so you can
							set interaction between the default material and other custom materials.
						</td>
					</tr>
				</tbody></table>
		<p>
			<a name="NDB_NewtonMaterialCreateGroupID"></a>
			<table cellspacing="0" bordercolorlight="#0506a5" bordercolordark="#0506a5" bgcolor="#ffffff"
				border="1" width="85%">
				<tbody>
					<tr>
						<td bgcolor="#232323"><h3><font color="#fafafa">NDB_NewtonMaterialCreateGroupID</font></h3>
						</td>
					</tr>
					<tr>
						<td bgcolor="#747ff6"><font color="#ffffff" face="monospace">syntax: int =
								NDB_NewtonMaterialCreateGroupID()</font></td>
					</tr>
					<tr>
						<td bgcolor="#fafafa"><font face="monospace">
								<table border="0" width="95%">
									<tbody>
										<tr>
											<td width="5%"></td>
											<td width="50%">no variables passed to this function</td>
											<td></td>
										</tr>
									</tbody></table>
							</font>
						</td>
					</tr>
					<tr>
						<td bgcolor="#dadada"><font face="monospace">returns: integer index of the newly
								created material group</font></td>
					</tr>
					<tr>
						<td bgcolor="#fafafa"><b>Comments:</b> To setup how objects interact, you first
							make materials. This command makes a new material, and gives you an index
							number to refer to it by. Then you can use the Material Setup Interface
							Commands to set how 2 materials should interact.</td>
					</tr>
				</tbody></table>
		<p>
			<a name="NDB_NewtonMaterialDestroyAllGroupID"></a>
			<table cellspacing="0" bordercolorlight="#0506a5" bordercolordark="#0506a5" bgcolor="#ffffff"
				border="1" width="85%">
				<tbody>
					<tr>
						<td bgcolor="#232323"><h3><font color="#fafafa">NDB_NewtonMaterialDestroyAllGroupID</font></h3>
						</td>
					</tr>
					<tr>
						<td bgcolor="#747ff6"><font color="#ffffff" face="monospace">syntax:
								NDB_NewtonMaterialDestroyAllGroupID</font></td>
					</tr>
					<tr>
						<td bgcolor="#fafafa"><font face="monospace">
								<table border="0" width="95%">
									<tbody>
										<tr>
											<td width="5%"></td>
											<td width="50%">no variables passed to this function</td>
											<td></td>
										</tr>
									</tbody></table>
							</font>
						</td>
					</tr>
					<tr>
						<td bgcolor="#dadada"><font face="monospace">returns: nothing</font></td>
					</tr>
					<tr>
						<td bgcolor="#fafafa"><b>Comments:</b> Deletes all materials. All rigid bodies must
							be deleted before this command is called.
						</td>
					</tr>
				</tbody></table>
		<p>
			<br>
			<br>
		</p>
		<h2>Material Setup Interface Commands</h2>
		<a name="NDB_NewtonMaterialSetDefaultCollidable"></a>
		<table cellspacing="0" bordercolorlight="#0506a5" bordercolordark="#0506a5" bgcolor="#ffffff"
			border="1" width="85%">
			<tbody>
				<tr>
					<td bgcolor="#232323"><h3><font color="#fafafa">NDB_NewtonMaterialSetDefaultCollidable</font></h3>
					</td>
				</tr>
				<tr>
					<td bgcolor="#747ff6"><font color="#ffffff" face="monospace">syntax:
							NDB_NewtonMaterialSetDefaultCollidable mat1, mat2, state</font></td>
				</tr>
				<tr>
					<td bgcolor="#fafafa"><font face="monospace">
							<table border="0" width="95%">
								<tbody>
									<tr>
										<td width="5%"></td>
										<td width="15%">mat1</td>
										<td>index of first material (integer)</td>
									</tr>
									<tr>
										<td width="5%"></td>
										<td width="15%">mat2</td>
										<td>index of second material (integer)</td>
									</tr>
									<tr>
										<td width="5%"></td>
										<td width="15%">state</td>
										<td>state for this pair. 1 = collidable, 0 non-collidable</td>
									</tr>
								</tbody></table>
						</font>
					</td>
				</tr>
				<tr>
					<td bgcolor="#dadada"><font face="monospace">returns: nothing</font></td>
				</tr>
				<tr>
					<td bgcolor="#fafafa"><b>Comments:</b> Use this command to set collision for a pair
						of materials.</td>
				</tr>
				<tr>
					<td bgcolor="#fafafa">
						<font face="monospace"><b>NDB_NewtonMaterialSetDefaultCollidable Metal, Char, 0</b></font>
						sets materials "Metal" and "Char" to NOT collide with each other by default.<br>
						<font face="monospace"><b>NDB_NewtonMaterialSetDefaultCollidable Plastic, Wood, 1</b></font>
						sets materials "plastic" and "wood" to collide by default.
					</td>
				</tr>
			</tbody></table>
		<p>
			<a name="NDB_NewtonMaterialSetDefaultFriction"></a>
			<table cellspacing="0" bordercolorlight="#0506a5" bordercolordark="#0506a5" bgcolor="#ffffff"
				border="1" width="85%">
				<tbody>
					<tr>
						<td bgcolor="#232323"><h3><font color="#fafafa">NDB_NewtonMaterialSetDefaultFriction</font></h3>
						</td>
					</tr>
					<tr>
						<td bgcolor="#747ff6"><font color="#ffffff" face="monospace">syntax:
								NDB_NewtonMaterialSetDefaultFriction mat1, mat2, static, kinetic</font></td>
					</tr>
					<tr>
						<td bgcolor="#fafafa"><font face="monospace">
								<table border="0" width="95%">
									<tbody>
										<tr>
											<td width="5%"></td>
											<td width="15%">mat1</td>
											<td>index of first material (integer)</td>
										</tr>
										<tr>
											<td width="5%"></td>
											<td width="15%">mat2</td>
											<td>index of second material (integer)</td>
										</tr>
										<tr>
											<td width="5%"></td>
											<td width="15%">static</td>
											<td>coeficient of static friction (float)</td>
										</tr>
										<tr>
											<td width="5%"></td>
											<td width="15%">kinetic</td>
											<td>coefiction of kinetic friction (float)</td>
										</tr>
									</tbody></table>
							</font>
						</td>
					</tr>
					<tr>
						<td bgcolor="#dadada"><font face="monospace">returns: nothing</font></td>
					</tr>
					<tr>
						<td bgcolor="#fafafa"><b>Comments:</b>Sets the friction values for a pair of
							materials. Both values should be positive, and are recommended to be between 0
							and 1.0</td>
					</tr>
					<tr>
						<td bgcolor="#fafafa">
							<font face="monospace"><b>NDB_NewtonMaterialSetDefaultFriction Char, Ice, 0.5, 0.15</b></font>
							sets friction between materials "char" and "ice" (static friction is pretty
							strong, but once you start sliding, there if little friction)<br>
							<font face="monospace"><b>NDB_NewtonMaterialSetDefaultFriction Rubber, Street, 0.95,
									0.88</b></font> sets friction between materials "Rubber" and "Street"
							very high for good traction.
						</td>
					</tr>
				</tbody></table>
		<p>
			<a name="NDB_NewtonMaterialSetDefaultElasticity"></a>
			<table cellspacing="0" bordercolorlight="#0506a5" bordercolordark="#0506a5" bgcolor="#ffffff"
				border="1" width="85%">
				<tbody>
					<tr>
						<td bgcolor="#232323"><h3><font color="#fafafa">NDB_NewtonMaterialSetDefaultElasticity</font></h3>
						</td>
					</tr>
					<tr>
						<td bgcolor="#747ff6"><font color="#ffffff" face="monospace">syntax:
								NDB_NewtonMaterialSetDefaultElasticity mat1, mat2, elasticity</font></td>
					</tr>
					<tr>
						<td bgcolor="#fafafa"><font face="monospace">
								<table border="0" width="95%">
									<tbody>
										<tr>
											<td width="5%"></td>
											<td width="15%">mat1</td>
											<td>index of first material (integer)</td>
										</tr>
										<tr>
											<td width="5%"></td>
											<td width="15%">mat2</td>
											<td>index of second material (integer)</td>
										</tr>
										<tr>
											<td width="5%"></td>
											<td width="15%">elasticity</td>
											<td>coeficient of elasticity (float)</td>
										</tr>
									</tbody></table>
							</font>
						</td>
					</tr>
					<tr>
						<td bgcolor="#dadada"><font face="monospace">returns: nothing</font></td>
					</tr>
					<tr>
						<td bgcolor="#fafafa"><b>Comments:</b> Sets the elasticity between a pair of
							materials.
						</td>
					</tr>
				</tbody></table>
		<p>
			<a name="NDB_NewtonMaterialSetDefaultSoftness"></a>
			<table cellspacing="0" bordercolorlight="#0506a5" bordercolordark="#0506a5" bgcolor="#ffffff"
				border="1" width="85%">
				<tbody>
					<tr>
						<td bgcolor="#232323"><h3><font color="#fafafa">NDB_NewtonMaterialSetDefaultSoftness</font></h3>
						</td>
					</tr>
					<tr>
						<td bgcolor="#747ff6"><font color="#ffffff" face="monospace">syntax:
								NDB_NewtonMaterialSetDefaultSoftness mat1, mat2, softness</font></td>
					</tr>
					<tr>
						<td bgcolor="#fafafa"><font face="monospace">
								<table border="0" width="95%">
									<tbody>
										<tr>
											<td width="5%"></td>
											<td width="15%">mat1</td>
											<td>index of first material (integer)</td>
										</tr>
										<tr>
											<td width="5%"></td>
											<td width="15%">mat2</td>
											<td>index of second material (integer)</td>
										</tr>
										<tr>
											<td width="5%"></td>
											<td width="15%">softness</td>
											<td>coeficient of softness (float)</td>
										</tr>
									</tbody></table>
							</font>
						</td>
					</tr>
					<tr>
						<td bgcolor="#dadada"><font face="monospace">returns: nothing</font></td>
					</tr>
					<tr>
						<td bgcolor="#fafafa"><b>Comments:</b> Sets the softness between a pair of
							materials.
						</td>
					</tr>
				</tbody></table>
		<p>
				<a name="NDB_NewtonMaterialSetContinuousCollisionMode"></a>
				<table cellspacing="0" bordercolorlight="#0506a5" bordercolordark="#0506a5" bgcolor="#ffffff"
					border="1" width="85%">
					<tbody>
						<tr>
							<td bgcolor="#232323"><h3><font color="#fafafa">NDB_NewtonMaterialSetContinuousCollisionMode</font></h3>
							</td>
						</tr>
						<tr>
							<td bgcolor="#747ff6"><font color="#ffffff" face="monospace">syntax:
									NDB_NewtonMaterialSetContinuousCollisionMode mat1, mat2, state</font></td>
						</tr>
						<tr>
							<td bgcolor="#fafafa"><font face="monospace">
									<table border="0" width="95%">
										<tbody>
											<tr>
												<td width="5%"></td>
												<td width="15%">mat1</td>
												<td>index of first material (integer)</td>
											</tr>
											<tr>
												<td width="5%"></td>
												<td width="15%">mat2</td>
												<td>index of second material (integer)</td>
											</tr>
											<tr>
												<td width="5%"></td>
												<td width="15%">state</td>
												<td>state for this pair. 1 = Continuous, 0 = Not Continuous</td>
											</tr>
										</tbody></table>
								</font>
							</td>
						</tr>
						<tr>
							<td bgcolor="#dadada"><font face="monospace">returns: nothing</font></td>
						</tr>
						<tr>
							<td bgcolor="#fafafa"><b>Comments:</b> Use this command to set continuous collision for a pair
								of materials.</td>
						</tr>
						<tr>
							<td bgcolor="#fafafa">
							<p><b>Remarks</b><br>Continuous collision mode enabled allows the engine to predict
							colliding contact on rigid bodies Moving at high speed of subject to strong
							forces.
							<p>Continuous collision mode does not prevent rigid bodies from inter
							penetration instead it prevent bodies from passing trough each others by
							extrapolating contact points when the bodies normal contact calculation
							determine the bodies are not colliding.
							<p>Continuous collision does not perform back tracking to determine
							time of contact, instead it extrapolate contact by incrementally extruding the
							collision geometries of the two colliding bodies along the linear velocity of
							the bodies during the time step, if during the extrusion colliding contact are
							found, a collision is declared and the normal contact resolution is called.
							<p>For continuous collision to be active the continue collision mode
							must on the material pair of the colliding bodies as well as on at least one of
							the two colliding bodies.
							<p>For performance reason the bodies angular velocities is only use
							on the broad face of the collision, but not on the contact calculation.
							Because there is penalty of about 40% to 80% depending of the
							shape complexity of the collision geometry, this feature is set off by default.
							It is the job of the application to determine what bodies need this feature on.
							Good guidelines are: very small objects, and bodies that move at a high speed.
							</td>
						</tr>
					</tbody></table>
		<p>
			<a name="NDB_NewtonMaterialSetCollisionCallback"></a>
			<table cellspacing="0" bordercolorlight="#0506a5" bordercolordark="#0506a5" bgcolor="#ffffff"
				border="1" width="85%">
				<tbody>
					<tr>
						<td bgcolor="#232323"><h3><font color="#fafafa">NDB_NewtonMaterialSetCollisionCallback</font></h3>
						</td>
					</tr>
					<tr>
						<td bgcolor="#747ff6"><font color="#ffffff" face="monospace">syntax:
								NDB_NewtonMaterialSetCollisionCallback mat1, mat2</font></td>
					</tr>
					<tr>
						<td bgcolor="#fafafa"><font face="monospace">
								<table border="0" width="95%">
									<tbody>
										<tr>
											<td width="5%"></td>
											<td width="15%">mat1</td>
											<td>index of first material (integer)</td>
										</tr>
										<tr>
											<td width="5%"></td>
											<td width="15%">mat2</td>
											<td>index of second material (integer)</td>
										</tr>
									</tbody></table>
							</font>
						</td>
					</tr>
					<tr>
						<td bgcolor="#dadada"><font face="monospace">returns: nothing</font></td>
					</tr>
					<tr>
						<td bgcolor="#fafafa"><b>Comments:</b> This is another important command. Setting
							this callback tells the wrapper to record all collisions that happen between
							bodies of these materials. You can use the <a href="ndb_docs_wrapper.htm#NDB_GetCollisionData">NDB_GetCollisionData</a> commands to check
							for / get information about the collisions.
						</td>
					</tr>
				</tbody></table>
		</p>
		<p>
			<a name="NDB_NewtonMaterialSetSphereCollisionCallback"></a>
			<table cellspacing="0" bordercolorlight="#0506a5" bordercolordark="#0506a5" bgcolor="#ffffff"
				border="1" width="85%">
				<tbody>
					<tr>
						<td bgcolor="#232323"><h3><font color="#fafafa">NDB_NewtonMaterialSetSphereCollisionCallback</font></h3>
						</td>
					</tr>
					<tr>
						<td bgcolor="#747ff6"><font color="#ffffff" face="monospace">syntax:
								NDB_NewtonMaterialSetSphereCollisionCallback mat1, mat2</font></td>
					</tr>
					<tr>
						<td bgcolor="#fafafa"><font face="monospace">
								<table border="0" width="95%">
									<tbody>
										<tr>
											<td width="5%"></td>
											<td width="15%">mat1</td>
											<td>index of first material (integer)</td>
										</tr>
										<tr>
											<td width="5%"></td>
											<td width="15%">mat2</td>
											<td>index of second material (integer)</td>
										</tr>
									</tbody></table>
							</font>
						</td>
					</tr>
					<tr>
						<td bgcolor="#dadada"><font face="monospace">returns: nothing</font></td>
					</tr>
					<tr>
						<td bgcolor="#fafafa"><b>Comments:</b> This function utilizes a custom collision callback
						that is tailored for sphere collisions.  Not necessary unless extreme accuracy is needed
						between a sphere and polygonal edges in a model (i.e. tiled floor).
						The use of <a href="db_docs_body.htm#NDB_BodySetSphere">NDB_BodySetSphere</a>
						is needed on one of the bodies in question for this to take effect.
						</td>
					</tr>
					<tr>
						<td bgcolor="#fafafa"><b>Remarks:</b> (From the 1.53 Newton SDK doc).
						In 99.9% of the cases the collision system can calculates a very good contact
						normal. however this algorithm that calculate the contact normal use as criteria
						the normal direction that will resolve the interpenetration with the least
						amount on motion. There are situations however when this solution is not the
						best. Take for example a rolling ball over a texelated floor, when the ball is
						over a flat polygon, the contact normal is always perpendicular to the floor and
						pass by the origin of the sphere, however when the sphere is going across two
						adjacent polygons, the contact normal is now perpendicular to the polygons edge
						and this does not guarantee they it will pass bay the origin of the sphere, but
						we know that the best normal is always the one passing by the origin of the
						sphere.
						</td>
					</tr>
				</tbody></table>
		</p>
		<p>
		</p>
	</body>
</html>
